#!/bin/bash

concurrent=3

index=0

for line in `/opt/modules/hadoop-3.3.4/bin/hdfs dfs -cat /hadoop/result/tmall/date_alipay_top_10/*.csv`
do
 {
   /opt/modules/spark-3.3.2-bin-hadoop3/bin/spark-submit --class com.learn.spark.analysis.ActionDateTopNDetails --master yarn /opt/package/tmall-data-analysis-1.0.0.jar alipay  ${line%,*}
}&
index=`expr $index + 1`
  [ `expr $index % $concurrent` -eq 0 ] && wait
done
wait
